package com.api.shopapi.mapper;

import com.api.shopapi.entity.NursingLevelItemRel;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface NursingLevelItemRelMapper {

    @Insert("insert into nursing_level_item_rel " +
            "(NursingLevelItemRelCode,NursingLevelCode,NursingItemCode) " +
            "values (#{nursingLevelItemRel.NursingLevelItemRelCode} ,#{nursingLevelItemRel.NursingLevelCode} ,#{nursingLevelItemRel.NursingItemCode} )")
    int insert(@Param("nursingLevelItemRel") NursingLevelItemRel nursingLevelItemRel);

    @Delete("delete from nursing_level_item_rel where nursingLevelCode=#{nursingLevelCode}")
    int delByNursingLevelCode(@Param("nursingLevelCode") String nursingLevelCode);

    @Select("select * from nursing_level_item_rel where nursingLevelCode=#{nursingLevelCode}")
    List<NursingLevelItemRel> getByNursingLevelCode(@Param("nursingLevelCode") String nursingLevelCode);

}
